// definition of keypoint of ai studio
function labelDef(data = {}) {
    // 定义模版
    let instance = {
        label_format: 'studio', // extended
        id: 0, // from coco
        area: 0, // from coco
        bbox: [], // from coco
        category_id: 0, // from coco
        category: 'unknown', // from coco/voc(diffrent field name)
        ignore: 0, // from coco
        iscrowd: 0, // from coco
        segmentation: [[]], // from coco
        pose: 'Unspecified', // from voc
        truncated: 0, // from voc
        occluded: 0, // from voc
        difficult: 0, // from voc
        num_keypoints: 0, // from coco
        keypoints: [], // from coco,
        caption: '' // from coco
    };

    // 根据data中有的key去更新里面的数据
    for (let key in data) {
        instance[key] = data[key];
    }

    return instance;
}

module.exports = labelDef;
